home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-07 / lanbook.zip / REBOOT.ASM < prev   
Assembly Source File  |  1991-09-22  |  1KB  |  63 lines

  1. ;
  2. ;   REBOOT.ASM
  3. ;
  4. ;   (c) 1990,1991   Adrian J.King
  5. ;
  6. ;        This code was developed for inclusion in the book
  7. ;        "Running LANtastic", by Adrian King, published by
  8. ;        Bantam Books, October 1991.
  9. ;
  10. ;   This module contains the assembler routine used
  11. ;   to reboot the machine.
  12. ;
  13. ;    Called as     reboot(COLDBOOT)     for a cold boot, and
  14. ;                reboot(WARMBOOT)    for a warm boot.
  15. ;
  16. ;    You reboot by moving either 1234h (warm) or 0h (cold)
  17. ;    to location 040:072 (the boot code is passed in as the
  18. ;    only parameter to the routine.) Then you jump to 
  19. ;    location 0ffff:0.
  20. ;
  21. ;$Header:   C:/USR/LANBOOK/SRC2/LAN/VCS/REBOOT.ASV   1.1   22 Sep 1991  8:23:28  $
  22. ;
  23. ;$Log:   C:/USR/LANBOOK/SRC2/LAN/VCS/REBOOT.ASV  $
  24. ;
  25. ;   Rev 1.1   22 Sep 1991  8:23:28
  26. ;Moved entercrit() and leavecrit() into nosif.asm.
  27. ;Cosmetic touch ups.
  28. ;
  29. ;   Rev 1.0   13 Jul 1991 11:21:40
  30. ;Initial revision.
  31. ;    
  32.  
  33.     .model  small,C
  34.  
  35.     .code
  36.  
  37.     PUBLIC  reboot                
  38.  
  39. reboot        PROC    FAR
  40.  
  41. bootflag    equ    [bp+6]            ; Location of parameter
  42.  
  43.     push    bp                      ; Standard C prologue
  44.     mov        bp, sp
  45.     mov        ax, 040h            ; Point to reboot word in ES:BX
  46.     mov        es,    ax
  47.     mov        bx,    072h
  48.  
  49. boot:
  50.     mov        ax, bootflag        ; Store boot flag
  51.     mov        es:[bx], ax
  52.     mov        ax,0ffffh            ; Set up address
  53.     push    ax
  54.     xor        ax,ax
  55.     push    ax
  56.     ret                            ; Return to FFFF:0
  57.  
  58.     hlt                            ; Should never get here
  59.  
  60. reboot    ENDP
  61.  
  62.     END
  63.